#ifndef __MOX_SLAVE_C_H__
#define __MOS_SLAVE_C_H__

void mox_slave(schanend mast);
void slave_handle_mod(unsigned state, int i, unsigned msg);
void slave_handle_thd(unsigned state, int i, unsigned msg_in);
void slave_handle_ct(schanend channel, unsigned tmp);

#ifndef __XC__

void slave_server(mox_slave_state *state, schanend mast);

int get_thd_index(mox_slave_state *state, unsigned thread_id);

int thread_is_mod(mox_slave_state *state, unsigned thread_id);

int thread_is_local(mox_slave_state *state, unsigned thread_id);

void slave_handle(mox_slave_state *state);

void slave_service_thds(mox_slave_state *state);

void slave_clear_chans(schanend chans[], unsigned n);

void handle_cmd(struct mox_slave_state *state, mox_msg *msg);

int init_mod_start(struct mox_slave_state *state, mox_msg *msg);

void master_thd_connect(struct mox_slave_state *state, mox_msg *msg);

int slave_create_thread(struct mox_slave_state *state, mox_msg *msg);

void init_slave(struct mox_slave_state *state);

#ifndef FLASHER

void transmit_func(schanend mast);
#endif


void s_malloc(schanend c);
void s_free(schanend c);
#endif


#endif //__MOX_SLAVE_C_H__
